package fr.mywiki.view.web.struts.form.modeling;

import java.rmi.RemoteException;
import java.util.ArrayList;

import org.apache.struts.action.ActionForm;

import fr.mywiki.business.entry.meta.EntryModel;
import fr.mywiki.business.entry.meta.EntryModelManager;
import fr.mywiki.view.array.ArrayController;
import fr.mywiki.view.array.ArrayDefinition;
import fr.mywiki.view.web.struts.form.ListForm;

/** The form for the modeling space. */
public class ModelsListForm extends ActionForm implements ListForm{
	private static final long serialVersionUID = 1L;

	/** The array controller for the models. */
	private ArrayController models;

	private String idElement;
	
	public void init() throws RemoteException {
		// Charging all the models by default
		ArrayList allModels = new ArrayList(EntryModelManager.findAllModels());
		this.models = new ArrayController(ArrayDefinition
				.getArrayDefinition(EntryModel.TYPE_ENT), allModels); 
	}
	
	public String getIdElement() {
		return idElement;
	}

	public void setIdElement(String idElement) {
		this.idElement=idElement;
	}

	public ArrayController getModels() {
		return models;
	}

	public void setModels(ArrayController models) {
		this.models = models;
	}
}
